<template>
  <div>
    <p ref="p">子组件中的p标签</p>
    <button @click="btn">获取p</button>
    <button @click="show">获取p</button>
  </div>
</template>

<script>
export default {
  methods:{
    btn(){
      const p = this.$refs.p
      console.log(p.innerHTML);
    },
    show(){
      console.log(5418);
    }
  }
}
</script>

<style>

</style>